home *** CD-ROM | disk | FTP | other *** search
/ MediaClips: Full Bloom / Aris MediaClips - Full Bloom.iso / mac / Full Bloom™ / Full Bloom™ / stack.txt < prev   
Text File  |  1993-05-18  |  31KB  |  924 lines

  1. -- stack: in
  2. -- format: 10 (HyperCard 2)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=640, y2=480)
  7. -- screen: Rect(x1=0, y1=0, x2=640, y2=480)
  8. -- card dimensions: w=640 h=480
  9. -- scroll: x=0 y=0
  10. -- background count: 1
  11. -- first background id: 2786
  12. -- card count: 2
  13. -- first card id: 4937
  14. -- list block id: 3986
  15. -- print block id: 6002
  16. -- font table block id: 3534
  17. -- style table block id: 3139
  18. -- free block count: 2
  19. -- free size: 17792 bytes
  20. -- total size: 73728 bytes
  21. -- stack block size: 28672 bytes
  22. -- created by hypercard version: 0x02108000
  23. -- compacted by hypercard version: 0x02108000
  24. -- modified by hypercard version: 0x02108000
  25. -- opened by hypercard version: 0x02108000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x00000E120E121F00
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x13FCCD8F
  67. ----- HyperTalk script -----
  68. -- Media ClipsΓäó
  69. -- RELEASE v.4.1
  70.  
  71. -- Written by Bill Dawson
  72. -- for Aris EntertainmentΓäó
  73.  
  74. --ΓÇó Externals Used In This Stack
  75. -- XFCN
  76. -- FindInField*,FileVersion**,GetDir,SystemPath*,Ants**,IsFile*,
  77. -- CDDriveList*,SCSIIDToName*,FolderPath*,FolderContents,Resources***,ChangeStr,ResFilOpen,
  78. -- ResNamExists,wsGet***,WindowScript***,ResourceList***,ScreenInfo***,NewFileName*
  79.  
  80. -- XCMD
  81. -- About**,CopyFile******,Textoid****,PutAlert*****,PICTToClip****,FindInXCMD*,CreateFolder,
  82. -- ResRemove,QTMovie*,QTPict*,ResFilClose,UseResFil,ResRename,CopyRes,wsSend***,wsSet***
  83. -- ClipToPict****
  84.  
  85. -- *      ┬⌐ Apple Computer, Inc.
  86. -- **     ┬⌐ Copyright 1988 - 90 by Jay Hodgdon, Ignatz Software
  87. -- ***    ┬⌐ Heizer Software, Lee Buck
  88. -- ****   ┬⌐ Frederic Rinaldi, 1990,1991
  89. -- *****  ┬⌐ 1989 by S.Koren & COM~LINK
  90. -- ****** ┬⌐ Guy de Picciotto
  91.  
  92. --ΓÇó Stack Scripts
  93. on openStack
  94.   global pList,ifBackground,windowName,theProgress,theDialog,stackOpen,theSplash
  95.   checkCPUtype
  96.   extractPrefs
  97.   if ifBackground = TRUE then get windowScript("Blackout")
  98.   if last item of screenInfo(MAIN) = 342 then
  99.     put "Splash(LC)"into theSplash -- LC
  100.   else put "Aris Splash" into theSplash
  101.   hide card window
  102.   if stackOpen Γëá TRUE then play "aris.logo"
  103.   put TRUE into stackOpen
  104.   get WindowScript(theSplash&return&"i0_IdleDelay:30"&return&"i3_Value:0"&return&"i3_Visible:TRUE")
  105.   set cursor to watch
  106.   showPicture
  107. end openStack
  108. on checkCPUtype -- more robust next time, but it's deadline now!
  109.   hide the scroll window
  110.   set the cantModify of this stack to FALSE
  111.   set the rect of this card to (word 2 to 5 of screenInfo(MAIN))
  112.   set the rect of the card window to (word 2 to 5 of screenInfo(MAIN))
  113. end checkCPUtype
  114. on cleanUp
  115.   global windowName
  116.   killOpenWindows
  117.   if there is a window windowName then close window windowName
  118.   KillAbout
  119.   killPalette
  120.   closePalette
  121.   deleteMenu
  122.   lock screen
  123.   --  show splash screen (Aris Logo) momentarily to reset CLUT
  124.   picture "Goodbye",resource,dialog
  125.   wait 3 sec
  126.   close window "Goodbye"
  127.   if there is a window "Blackout" then close window "Blackout"
  128.   show cd window
  129. end cleanUp
  130. on idle
  131.   global moviePlaying,newPict
  132.   if moviePlaying Γëá TRUE then checkWindow
  133.   if newPict = TRUE then
  134.     put FALSE into newPict
  135.     showPicture
  136.   end if
  137.   checkPalette
  138.   if the sound = "done" then stopSound
  139. end idle
  140. on killOpenWindows
  141.   global pictureList,checkPICT,theOid,windowName,lastPictID,currPictID
  142.   set cursor to 4
  143.   if currPictID Γëá lastPictID and there is a window id lastPictID then close window id lastPictID
  144.   if there is a window theOid then close window theOid
  145.   put TRUE into checkPICT
  146. end killOpenWindows
  147. --ΓÇó Pictures
  148. on openPicture which
  149.   global currPictID
  150.   put id of window which into currPictID
  151. end openPicture
  152. on showPicture
  153.   global windowName,pDepth,pSize,pStyle,altPath,lastSnd,ifSound,currPictID,lastPictID,ifXL, theSplash
  154.   if there is a window theSplash then close window theSplash
  155.   set cursor to 4
  156.   if altPath Γëá empty then
  157.     checkBitDepth
  158.     set cursor to watch
  159.     if pSize = "" and pDepth = "24 Bit" and item 3 of screenInfo(Main) ΓëÑ 640 and ifXL = TRUE then
  160.       if isFile(locateF() & pDepth & " XL" & ":"&windowName) then put " XL" into pSize
  161.     end if
  162.     put getEOF(locateF() & pDepth & pSize & ":"&windowName) into bufferSize
  163.     if (bufferSize * 2) + 301 < the heapSpace then
  164.       put currPictID into lastPictID
  165.       picture locateF() & pDepth & pSize & ":"&windowName,file,pStyle,true
  166.       killOpenWindows
  167.     else if bufferSize + 301 > the heapSpace then
  168.       if there is a window id currPictID then close window id currPictID
  169.       killOpenWindows
  170.       put currPictID into lastPictID
  171.       picture locateF() & pDepth & pSize & ":"&windowName,file,pStyle,true,0
  172.     else
  173.       if there is a window id currPictID then close window id currPictID
  174.       killOpenWindows
  175.       put currPictID into lastPictID
  176.       picture locateF() & pDepth & pSize & ":"&windowName,file,pStyle,false
  177.     end if
  178.     put FALSE into newSize
  179.     checkWindow
  180.     getInfo
  181.     if ifSound then
  182.       playSound
  183.     end if
  184.   else
  185.     listDir
  186.   end if
  187.   checkWindow
  188. end showPicture
  189. on closePicture windowName
  190.   global windowName,pictureList
  191.   checkwindow
  192. end closePicture
  193. on mouseDownInPicture
  194.   global theSplash
  195.   if there is a window theSplash then
  196.     hide window theSplash
  197.     close window theSplash
  198.     showPicture
  199.   end if
  200.   wait 10
  201.   if the mouseClick then doZoom
  202. end mouseDownInPicture
  203. --ΓÇó Menus
  204. on createMenu
  205.   if there is a menu "ArisΓäó" then exit createMenu
  206.   create menu "ArisΓäó"
  207.   put createMenuItems() into menu "ArisΓäó" -- with menuMsg createMenuMsgs()
  208.   if there is a menu "Edit" then
  209.     if last menuItem of menu "Edit" = "Icon..." then
  210.       set commandChar of last menuItem of menu "Edit" to ""
  211.     end if
  212.   end if
  213.   set the commandChar of menuItem 3 of menu "ArisΓäó" to "9"
  214.   set the commandChar of menuItem 5 of menu "ArisΓäó" to "I"
  215.   set the commandChar of menuItem 9 of menu "ArisΓäó" to "?"
  216. end createMenu
  217. function createMenuItems
  218. return "Sound" & return & "-" & return & "Palette" & return & "-" & return & "Show Info..." & return & "Preferences" & return & "-" & return & "Switch Disks..." & return & "Help" & return
  219. end createMenuItems
  220. function createMenuMsgs
  221. return "" & return & "" & return & "" & return & "" & return & "" & return & "" & return & "" & return & "" & return & "" & return
  222. end createMenuMsgs
  223. on deleteMenu
  224.   if there is a menu "ArisΓäó" then delete menu "ArisΓäó"
  225. end deleteMenu
  226. on doMenu whichMenu
  227.   global ifSound,ifInfo,useAltPath,altPath,paletteName
  228.   if whichMenu = "Sound" then
  229.     if the checkmark of menuItem "Sound" of menu "ArisΓäó" = FALSE then
  230.       set the checkmark of menuItem "Sound" of menu "ArisΓäó" to TRUE
  231.       put TRUE into ifSound
  232.       playSound
  233.     else
  234.       set the checkmark of menuItem "Sound" of menu "ArisΓäó" to FALSE
  235.       put FALSE into ifSound
  236.     end if
  237.   else if whichMenu = "Palette" then
  238.     if the checkmark of menuItem "Palette" of menu "ArisΓäó" = FALSE then
  239.       createPalette
  240.     else
  241.       killPalette
  242.     end if
  243.   else if whichMenu = "Show Info..." then
  244.     if the checkmark of menuItem "Show Info..." of menu "ArisΓäó" = FALSE then
  245.       set the checkmark of menuItem "Show Info..." of menu "ArisΓäó" to TRUE
  246.       put TRUE into ifInfo
  247.       doAbout
  248.     else
  249.       set the checkmark of menuItem "Show Info..." of menu "ArisΓäó" to FALSE
  250.       put FALSE into ifInfo
  251.       doAbout
  252.     end if
  253.   else if whichMenu = "Preferences" then
  254.     send showPrefs to card
  255.   else if whichMenu = "Help" then
  256.     putAlert "",108 -- Palette Help
  257.     if the result = 2 then
  258.       putAlert "",105 -- Menu Help
  259.       if the result = 2 then doMenu "Help"
  260.     end if
  261.   else if whichMenu = "Compact Stack" then
  262.     killPalette
  263.     if there is a window "Blackout" then close window "Blackout"
  264.     pass doMenu
  265.   else if whichMenu = "About Hypercard..." then
  266.     global windowName,theSplash
  267.     get ResFilOpen(value of word 2 of the long name of this stack)
  268.     if there is a window windowName then hide window windowName
  269.     picture "a", resource, dialog
  270.     close window "a"
  271.     get item 5 of the long version of this stack
  272.     convert it to short date
  273.     get WindowScript(theSplash&return&"i2_Text:"&"Version"&&fileVersion("short")&&"-" && it)
  274.     if there is a window windowName then
  275.       show window windowName
  276.     end if
  277.   else if whichMenu = "Find..." then goFind
  278.   else if whichMenu = "Switch Disks..." then
  279.     get FolderPath("Please locate a ΓÇ£Media ClipsΓäóΓÇ¥ Disk or Folder for me.")
  280.     if it Γëá empty then
  281.       put it into altPath
  282.       put TRUE into useAltPath
  283.       showFirst
  284.     end if
  285.   else if whichMenu = "First" then
  286.     showFirst
  287.   else if whichMenu = "Next" then
  288.     showNext
  289.   else if whichMenu = "Prev" then
  290.     showPrev
  291.   else if whichMenu = "Last" then
  292.     showLast
  293.   else if whichMenu = "Quit Hypercard" then
  294.     cleanUp
  295.     pass doMenu
  296.   else pass doMenu
  297. end doMenu
  298. on makeAbout
  299.   About "About Media ClipsΓäó..."
  300. end makeAbout
  301. on KillAbout
  302.   About "About Hypercard..."
  303. end killAbout
  304. --ΓÇó Palette
  305. on createPalette
  306.   global paletteName,pLoc
  307.   set checkmark of menuItem "Palette" of menu "ArisΓäó" to TRUE
  308.   get FolderContents(locateF("Movies") & "Movies:",files,"noDialog")
  309.   if it contains "Sorry" or it is empty or hasQT() = FALSE then put "wsPaletteSM" into paletteName
  310.   else put "wsPalette" into paletteName
  311.   if pLoc = empty then
  312.     if paletteName contains "Sm" then
  313.       put (item 3 of the screenrect - 406)/2 & "," & item 4 of the screenrect - 53 into pLoc
  314.     else put (item 3 of the screenrect - 440)/2 & "," & item 4 of the screenrect - 53 into pLoc
  315.   end if
  316.   if there is a window paletteName then
  317.     show window paletteName
  318.     exit createPalette
  319.   else
  320.     get windowScript(paletteName & return & "i0_TopLeft:" & pLoc)
  321.   end if
  322. end createPalette
  323. on createPaletteZ
  324.   global pLoc,paletteName
  325.   put "z" into char 1 of paletteName
  326.   if pLoc = empty then
  327.     put (item 3 of the screenrect - 440)/2 & "," & item 4 of the screenrect - 53 into pLoc
  328.   end if
  329.   if there is a window paletteName then
  330.     show window paletteName
  331.     exit createPaletteZ
  332.   else
  333.     palette paletteName,pLoc
  334.   end if
  335. end createPaletteZ
  336. on switchPalette which
  337.   if which = on then
  338.     killPalette
  339.     createPaletteZ
  340.   else if which = off then
  341.     killPalette
  342.     createPalette
  343.   end if
  344. end switchPalette
  345. on checkPalette
  346.   global paletteName
  347.   if there is a window paletteName then
  348.     send "bringtofront" to window paletteName
  349.     show window paletteName
  350.   end if
  351. end checkPalette
  352. on checkWindow
  353.   global windowName
  354.   if there is a window blackout then wsSend Blackout,0,"sendtoback"
  355.   if there is a window windowName then show window windowName
  356. end checkWindow
  357. on killPalette
  358.   global paletteName
  359.   if there is a window paletteName then close window paletteName
  360.   set checkmark of menuItem "Palette" of menu "ArisΓäó" to FALSE
  361. end killPalette
  362. on openPalette
  363.   set the checkmark of menuItem "Palette" of menu "ArisΓäó" to TRUE
  364. end openPalette
  365. on closePalette
  366.   global pLoc,paletteName
  367.   if there is a window paletteName then
  368.     put the loc of window paletteName into pLoc
  369.   end if
  370.   if there is a menu "ArisΓäó" then
  371.     set the checkmark of menuItem "Palette" of menu "ArisΓäó" to FALSE
  372.   end if
  373. end closePalette
  374. function ifPalette
  375. global paletteName
  376. if there is a window paletteName then
  377.   return TRUE
  378. else return FALSE
  379. end ifPalette
  380. --ΓÇó Palette Handlers
  381. on showFirst
  382.   global pList,windowName,theOid
  383.   if pList = empty then listDir
  384.   put line 1 of pList into windowName
  385.   showPicture
  386. end showFirst
  387. on showPrev
  388.   global pList,windowName,theOid
  389.   if pList = empty then listDir
  390.   get findInField(pList,windowName,"",0)
  391.   if item 3 of it Γëá 1 then put item 1 of it into start
  392.   else put 0 into start
  393.   get item 2 of findInField(pList,windowName,"",start)
  394.   if it = 1 then put line (number of lines of pList) of pList into windowName
  395.   else put line it - 1 of pList into windowName
  396.   showPicture
  397. end showPrev
  398. on showNext
  399.   global pList,windowName,pList,theOid
  400.   if pList = empty then listDir
  401.   get findInField(pList,windowName,"",0)
  402.   if item 3 of it Γëá 1 then put item 1 of it into start
  403.   else put 0 into start
  404.   get item 2 of findInField(pList,windowName,"",start)
  405.   if it Γëá (number of lines of pList) then
  406.     put line item 2 of findInField(pList,windowName,"",start) + 1 of pList into windowName
  407.   else put line 1 of pList into windowName
  408.   showPicture
  409. end showNext
  410. on showLast
  411.   global pList,windowName,theOid
  412.   if pList = empty then listDir
  413.   put last line of pList into windowName
  414.   showPicture
  415. end showLast
  416. on Save2disk
  417.   global windowName,fileName,newName,pDepth,pSize,moviePlaying
  418.   if moviePlaying Γëá TRUE then
  419.     putAlert "",107
  420.     if the result = 2 then exit Save2Disk
  421.     else if the result = 3 then put "pict" into theRes
  422.     else if the result = 4 then put "pict" into theRes
  423.     else if the result = 5 then put "snd" into theRes
  424.     else if the result = 6 then put "snd" into theRes
  425.     if theRes = empty then
  426.       exit Save2Disk
  427.     else if theRes = "pict" then
  428.       put locateF() & pDepth & pSize & ":" & windowName into fileName
  429.     else if theRes = "snd" then
  430.       put locateF() & "Snd Files:" & windowName into fileName
  431.     end if
  432.     ask file "Save" && theRes && "file as:" with windowName & "." & theRes
  433.     if it Γëá empty then
  434.       put it into newName
  435.       copyFile fileName, newName, o
  436.       if the result = "0" then
  437.         if theRes = "snd" then put changeFileType(newName,"sfile","movr") into smChange
  438.         answer "ΓÇ£" & theRes & "ΓÇ¥" && "file copied successfully!" with "Cool!"
  439.       else answer "Unable to complete operation." with "Sorry"
  440.     end if
  441.   else answer "Exporting movies is not yet implimented." & return & return & "Quit and copy movie from the ΓÇ£MoviesΓÇ¥ folder." with "Rats!"
  442. end save2disk
  443. on goFind
  444.   global findMe,numHit,searchHits,ifFind,hitPath
  445.   if there is not a window "Find" then
  446.     get windowScript("Find" & return & "i0_Height:72" & return & "i2_Text:" & findMe & return & "i7_Text:" & numHit & return & "i9_Wordwrap:TRUE" & return & "i12_Visible:FALSE")
  447.     set "i8_Text" of window "Find" to searchHits
  448.     set "i9_Text" of window "Find" to hitPath
  449.   end if
  450. end goFind
  451. -- *No longer a Palette handler, but used on mouseDownInPicture*
  452. on doZoom
  453.   global windowName,theOid,pDepth,pSize,pStyle,smallStyle,ThumbStyle,FullStyle
  454.   if there is a window windowName then close window windowName
  455.   if pSize contains "small" then
  456.     getFull
  457.   else if pSize contains "Thumbnails" then
  458.     getSmall
  459.   else
  460.     getThumb
  461.   end if
  462. end doZoom
  463. on doExport
  464.   global windowName,pDepth,pSize,newRect,fileName,newName,moviePlaying,nowPlaying
  465.   put the visible of cd window into restoreWindow
  466.   show cd window
  467.   checkPalette
  468.   if there is a window "Blackout" then send "Sendtoback" to window "Blackout"
  469.   show window windowName
  470.   put locateF() & pDepth & pSize & ":" & windowName into fileName
  471.   put the rect of cd window into cdRect
  472.   put the rect of window windowName into subRect
  473.   put ants() into theRect -- the rect returned from the userΓÇÖs selection
  474.   put item 1 of cdRect + item 1 of theRect - item 1 of subRect into item 1 of newRect
  475.   put item 2 of cdRect + item 2 of theRect - item 2 of subRect into item 2 of newRect
  476.   put item 3 of theRect - item 1 of theRect + item 1 of newRect into item 3 of newRect
  477.   put item 4 of theRect - item 2 of theRect + item 2 of newRect into item 4 of newRect
  478.   set cursor to watch
  479.   if moviePlaying Γëá TRUE then
  480.     ask file "Name for new PICT file" with windowName & ".pict"
  481.   else ask file "Save movie clip as:" with nowPlaying & ".movie clip"
  482.   if it Γëá empty then
  483.     set cursor to watch
  484.     put it into newName
  485.     PICTToClip fileName,"False",newRect
  486.     put ClipToPict(newName,MDRW) into result
  487.     if the result contains "Error" then
  488.       answer "Not enough memory to complete operation." & return & "Try ΓÇ£Save to DiskΓÇ¥ or ΓÇ£QuitΓÇ¥ & try again." with "Sorry"
  489.     else
  490.       put changeFileType(newName,"PICT","8BIM") into smChange
  491.     end if
  492.   end if
  493.   set the visible of cd window to restoreWindow
  494. end doExport
  495. on playSound x
  496.   global windowName,lastSnd,myRefNum,ifSlideShow,paletteName,sndfileName,stopShow
  497.   if ifSlideShow = empty then put false into ifSlideShow
  498.   if windowName Γëá lastSnd then
  499.     put locateF() & "Snd Files:" & windowName into sndfileName
  500.   end if
  501.   put windowName into lastSnd
  502.   if ifSlideShow then
  503.     if the sound is "done" then
  504.       set cursor to 4
  505.       playItAgainSoundm sndFileName,windowName
  506.       put windowName into the sound
  507.     else
  508.       play stop
  509.       put "done" into the sound
  510.       createPalette
  511.     end if
  512.     exit playSound
  513.   end if
  514.   if the sound Γëá "done" then
  515.     play stop
  516.     put "done" into the sound
  517.     if paletteName contains "Sm" then
  518.       set i6_Name of window paletteName to nosound
  519.     else set i7_Name of window paletteName to nosound
  520.   else
  521.     if paletteName contains "Sm" then
  522.       set i6_Name of window paletteName to sound
  523.     else set i7_Name of window paletteName to sound
  524.     set cursor to 4
  525.     playItAgainSound sndFileName,windowName
  526.     put windowName into the sound
  527.   end if
  528. end playSound
  529. on stopSound
  530.   global paletteName
  531.   if there is a window paletteName then
  532.     if paletteName contains "Sm" then
  533.       if i6_Name of window paletteName Γëá nosound then
  534.         set i6_Name of window paletteName to nosound
  535.       end if
  536.     else
  537.       if i7_Name of window paletteName Γëá nosound then
  538.         set i7_Name of window paletteName to nosound
  539.       end if
  540.     end if
  541.   end if
  542. end stopSound
  543. on sndPicker
  544.   checkColor
  545.   if there is not a window "Sound Picker" then
  546.     get windowScript("Sound Picker")
  547.     send BuildSndList to card
  548.     set i1_GrowItem of window "Sound Picker" to true
  549.   end if
  550. end sndPicker
  551. on getPICT
  552.   -- Picture "Picker" window
  553.   global pDepth,pSize,windowName,myRefNumber,ICNfileName,pList
  554.   if there is not a window "Picture Picker" then
  555.     if there is a window windowName then hide window windowName
  556.     put locateF() & "Data:" & discName() & ".Resources" into ICNfileName
  557.     if isFile(ICNfilename) Γëá TRUE then
  558.       put thisPath() & discName() & ".Resources" into ICNfileName
  559.     end if
  560.     if isFile(ICNfilename) and the optionKey = UP then
  561.       if pDepth Γëá "24 bit" then picture "a", resource, dialog
  562.       get windowScript("Picture Picker")
  563.       put ResourceList(ICNfileName,"ICN#","ID") into x
  564.       put resFilOpen(ICNfileName) into myRefNumber
  565.       set i1_Text of window "Picture Picker" to x
  566.       set i1_GrowItem of window "Picture Picker" to true
  567.       if there is a window "a" then
  568.         close window "a"
  569.       end if
  570.     else if isFile(ICNfilename) and the optionKey = DOWN then
  571.       get windowScript("Picture Picker")
  572.       set i1_Style of window "Picture Picker" to "Standard"
  573.       set i1_Text of window "Picture Picker" to pList
  574.       set i1_GrowItem of window "Picture Picker" to true
  575.     else if the optionKey = UP then
  576.       get windowScript("Picture Picker")
  577.       set i1_Style of window "Picture Picker" to "Standard"
  578.       set i1_Text of window "Picture Picker" to pList
  579.       set i1_GrowItem of window "Picture Picker" to true
  580.     else
  581.       send BuildListOfICNs to background
  582.     end if
  583.   end if
  584. end getPICT
  585. function thispath
  586. get the value of word 2 of the long name of this stack
  587. delete char (length of it - length of short name of this stack)+1 to (Length of it) of it
  588. put it into checkPath
  589. return checkPath
  590. end thispath
  591. function discName
  592. get LocateF()
  593. delete last char of it
  594. return it
  595. end discName
  596. on slideShow
  597.   global pList,windowName,pList,ifSound,theOid,paletteName,ifSlideShow,stopShow
  598.   put true into ifSlideShow
  599.   put false into stopShow
  600.   hide window paletteName
  601.   hide menubar
  602.   repeat
  603.     if the mouseClick or stopShow then exit repeat
  604.     if there is a window theOid then close window theOid
  605.     showNext
  606.     put the ticks into Start_Ticks
  607.     repeat
  608.       if the mouseClick or stopShow then
  609.         put true into stopShow
  610.         put false into ifSlideShow
  611.         play stop
  612.         createPalette
  613.         show window paletteName
  614.         show menubar
  615.         exit slideShow
  616.       end if
  617.       if ifSound then
  618.         if the sound is "done" or stopShow then
  619.           exit repeat
  620.         end if
  621.       else if the ticks - Start_Ticks > 300 then exit repeat
  622.     end repeat
  623.   end repeat
  624.   show menubar
  625.   put true into stopShow
  626.   put false into ifSlideShow
  627. end slideShow
  628. on doAbout
  629.   global windowName,moviePlaying
  630.   if moviePlaying Γëá TRUE then
  631.     get "File:" && windowName
  632.     lookUp it
  633.     getTextoid
  634.   end if
  635. end doAbout
  636. on getThumb
  637.   global windowName,theOid,pDepth,pSize,pStyle,ThumbStyle,wID
  638.   if there is a window windowName then put ID of window windowName into wID
  639.   put " Thumbnails" into pSize
  640.   put ThumbStyle into pStyle
  641.   showPicture
  642. end getThumb
  643. on getSmall
  644.   global windowName,theOid,pDepth,pSize,pStyle,SmallStyle,wID
  645.   if there is a window windowName then put ID of window windowName into wID
  646.   put " (small)" into pSize
  647.   put SmallStyle into pStyle
  648.   showPicture
  649. end getSmall
  650. on getFull
  651.   global windowName,theOid,pDepth,pSize,pStyle,FullStyle,wID
  652.   if there is a window windowName then put ID of window windowName into wID
  653.   put empty into pSize
  654.   put FullStyle into pStyle
  655.   showPicture
  656. end getFull
  657. on QTshow
  658.   send getPreviews to background
  659. end QTshow
  660. on playQT
  661.   global QTFlick,moviePlaying,nowPlaying
  662.   put FolderContents(locateF("Movies") & "Movies:",files,"noDialog") into QTlist
  663.   if QTlist contains "Sorry" then
  664.     answer "Sorry, no QuickTimeΓäó movies were found." & return & return & "(Try selecting ΓÇ£Switch Disks...ΓÇ¥ from the ΓÇ£ArisΓäóΓÇ¥ menu.)"
  665.   else
  666.     killOpenMovies
  667.     put TRUE into moviePlaying
  668.     -- if there is a window "Movie Picker" then put "273,146" into MooVloc
  669.     put main into MooVloc
  670.     if word 3 of i27_Name of window "Movie Picker" = FALSE then
  671.       QTMovie openMovie,TallWindoid,locateF("Movies") & "Movies:" & nowPlaying,MooVloc
  672.     else
  673.       hide window "Movie Picker"
  674.       QTMovie openMovie,TallWindoid,locateF("Movies") & "Movies:" & nowPlaying,MooVloc
  675.     end if
  676.     set WindowCloseMsg of window nowPlaying to movieClosed
  677.   end if
  678. end playQT
  679. on movieClosed
  680.   if there is a window "Movie Picker" then show window "Movie Picker"
  681. end movieClosed
  682. on QTMovie
  683.   global nowPlaying,movieList
  684.   put nowPlaying & return after movieList
  685.   pass QTMovie
  686. end QTMovie
  687. on killOpenMovies
  688.   global movieList
  689.   repeat with i = 1 to the number of lines of movieList
  690.     if there is a window line i of movieList then close window line i of movieList
  691.   end repeat
  692.   put empty into movieList
  693. end killOpenMovies
  694. on QTclose
  695.   global moviePlaying
  696.   put FALSE into moviePlaying
  697. end QTclose
  698. --ΓÇó Textoid
  699. on openTextoid which
  700.   global theOid,windowName,oidRect
  701.   put which into theOid
  702.   if oidRect = empty then set the globalRect of window theOid to "196,32,446,113"
  703.   else set the globalRect of window theOid to oidRect
  704. end openTextoid
  705. on closeTextoid which
  706.   global theOid,oidRect
  707.   put the globalRect of window theOid into oidRect
  708.   put empty into theOid
  709. end closeTextoid
  710. on getTextoid
  711.   global windowName,theData
  712.   get (line 1 of theData)
  713.   delete char 1 to 6 of it
  714.   if there is not a window (it && "Info") then
  715.     Textoid it && "Info",theData,"Geneva","9"
  716.   else close window (it && "Info")
  717.   testError the Result
  718. end getTextoid
  719. on TestError What
  720.   if What Γëá empty
  721.   then
  722.   beep
  723.   answer What
  724.   exit to HyperCard
  725. end if
  726. end TestError
  727. --ΓÇó Find
  728. on arisFind x
  729.   global theData,windowName,numHit,searchHits,findMe,searchMe
  730.   put empty into searchMe
  731.   put locateF() & "data:aris.data" into fileName
  732.   open file fileName
  733.   repeat
  734.     read from file fileName for 16384 -- max I/O buffer
  735.     put it after searchMe
  736.     if it = empty then exit repeat
  737.   end repeat
  738.   close file fileName
  739. end arisFind
  740. on lookUp x
  741.   global theData,windowName
  742.   put locateF() & "data:aris.data" into fileName
  743.   put empty into theData
  744.   open file fileName
  745.   repeat
  746.     read from file fileName for 16384
  747.     put it after theData
  748.     if it = empty then exit repeat
  749.   end repeat
  750.   close file filename
  751.   findInXCMD theData,x,1,FALSE
  752.   put item 4 of the result into startChar
  753.   findInXCMD theData,"Γëê",startChar,FALSE
  754.   put item 5 of the result into endChar
  755.   get char startChar to endChar of theData
  756.   delete last line of it -- kill "Γëê"
  757.   if last char of it = return then delete last char of it -- kill return
  758.   put it into thedata
  759. end lookUp
  760. --ΓÇó Sound
  761. on checkSnd
  762.   global ifSound
  763.   if ifSound = TRUE then
  764.     if there is a menu "ArisΓäó" then
  765.       set checkMark of menuItem "Sound" of menu "ArisΓäó" to true
  766.     end if
  767.   else if there is a menu "ArisΓäó" then
  768.     set checkMark of menuItem "Sound" of menu "ArisΓäó" to false
  769.   end if
  770. end checkSnd
  771. --ΓÇó Info
  772. on checkInfo
  773.   global ifInfo
  774.   extractPrefs
  775.   if ifInfo = TRUE then
  776.     set checkMark of menuItem "Show Info..." of menu "ArisΓäó" to true
  777.   else set checkMark of menuItem "Show Info..." of menu "ArisΓäó" to false
  778. end checkInfo
  779. on getInfo
  780.   global windowName
  781.   if the checkMark of menuItem "Show Info..." of menu "ArisΓäó" then doAbout
  782. end getInfo
  783. --ΓÇó Preferences
  784. on ExtractPrefs
  785.   global dResult,ifBackground,ifSound,pSize,pStyle,theData,ifInfo,ifFullSize,ifSmall,ifThumb,FullStyle,SmallStyle,ThumbStyle,defaultSize,bgColor,ifXL
  786.   get openPrefs("aris.prefs")
  787.   put "Background=,Sound=,Info=,Size=,Style=,FullStyle=,SmallStyle=,ThumbStyle=,bgColor=,ifXL=" into lookWhat
  788.   repeat with i = 1 to the number of items in lookWhat
  789.     get findInField(theData,item i of lookWhat)
  790.     put item 1 of it + length of line item 2 of it of theData - 2 into stopChar
  791.     put char item 1 of it + length of item i of lookWhat to stopChar of theData into item i of intoWhat
  792.   end repeat
  793.   put item 1 of intoWhat into ifBackground
  794.   put item 2 of intoWhat into ifSound
  795.   put item 3 of intoWhat into ifInfo
  796.   put item 4 of intoWhat into pSize
  797.   put item 5 of intoWhat into pStyle
  798.   put item 6 of intoWhat into FullStyle
  799.   put item 7 of intoWhat into SmallStyle
  800.   put item 8 of intoWhat into ThumbStyle
  801.   put item 9 of intoWhat into bgColor
  802.   put item 10 of intoWhat into ifXL
  803.   put pSize into defaultSize
  804.   if pSize = empty then put TRUE into ifFullSize
  805.   else put FALSE into ifFullSize
  806.   if pSize = " (small)" then put TRUE into ifSmall
  807.   else put FALSE into ifSmall
  808.   if pSize = " Thumbnails" then put TRUE into ifThumb
  809.   else put FALSE into ifThumb
  810. end ExtractPrefs
  811. on writePrefs
  812.   global theData
  813.   createFolder SystemPath() & "Preferences" -- does nothing if it exists
  814.   put SystemPath() & "Preferences:aris.prefs" into fileName
  815.   open file fileName
  816.   write theData to file fileName
  817.   close file fileName
  818. end writePrefs
  819. --ΓÇó┬áCheck Bit Depth
  820. on CheckBitDepth
  821.   global pDepth,pSize
  822.   if last item of screenInfo(MAIN) = 342 then -- LC
  823.     if pSize = empty then
  824.       put "8 Bit LC" into pDepth
  825.     else put "8 Bit" into pDepth
  826.     exit checkBitDepth
  827.   end if
  828.   if (word 1 of screenInfo(MAIN)) > 256 then
  829.     if pSize = empty then
  830.       put "24 Bit" into pDepth
  831.     else put "8 Bit" into pDepth
  832.   else if (word 1 of screenInfo(MAIN)) = 256 then put "8 Bit" into pDepth
  833.   else if (word 1 of screenInfo(MAIN)) < 256 then putAlert "",103
  834. end CheckBitDepth
  835. --• Functions
  836. function PICTsize
  837. global pSize
  838. if pSize = empty then put " (small)" into pSize
  839. return pSize
  840. end PICTsize
  841. function locateF x
  842. global altPath,pDepth,pSize,windowName
  843. if altPath = empty then listDir
  844. return altPath
  845. end locateF
  846. on listDir
  847.   global useAltPath,altPath,pDepth,pList
  848.   if useAltPath Γëá TRUE then
  849.     -- Check local path to see if we're in our own directory
  850.     get the value of word 2 of the long name of this stack
  851.     delete char (length of it - length of short name of this stack)+1 to (Length of it) of it
  852.     put it into checkPath
  853.     if "aris.data" is in FolderContents(checkPath & "Data", "Files","noDialog") then
  854.       put checkPath into altPath
  855.       put GetDir(checkPath & pDepth,"F","t=PICT","o=n") into pList
  856.       put ChangeStr(pList,"[44]",",","all") into pList
  857.       exit listDir
  858.     end if
  859.     -- check other SCSI drives for CD-ROMs
  860.     get line 1 of cdDriveList("noDialog")
  861.     if "Error" is not in it then
  862.       repeat with i = 1 to the number of items of it
  863.         put SCSIIDToName(item i of it) into SCSIPath
  864.         if it Γëá empty then
  865.           if "aris.data" is in FolderContents(SCSIPath & "Data:", "Files","noDialog") then
  866.             put SCSIPath into altPath
  867.             put GetDir(altPath & pDepth,"F","t=PICT","o=n") into pList
  868.             put ChangeStr(pList,"[44]",",","all") into pList
  869.             exit listDir
  870.           end if
  871.         end if
  872.       end repeat
  873.     end if
  874.   end if
  875.   repeat
  876.     -- Ask User
  877.     if "aris.data" is not in FolderContents(altPath & "Data:", "Files","noDialog") then
  878.       get FolderPath("Please locate the ΓÇ£Media ClipsΓäóΓÇ¥ Disk or Folder for me.")
  879.       if it = empty then
  880.         put empty into altPath
  881.         exit listDir
  882.       else
  883.         if it contains "Error" then
  884.           put empty into altPath
  885.         else
  886.           put it into altPath
  887.           next repeat
  888.         end if
  889.       end if
  890.     else
  891.       if "aris.data" is in FolderContents(altPath & "Data:", "Files","noDialog") then
  892.         put GetDir(altPath & pDepth,"F","t=PICT","o=n") into pList
  893.         put ChangeStr(pList,"[44]",",","all") into pList
  894.         exit listDir
  895.       end if
  896.     end if
  897.   end repeat
  898. end listDir
  899. Function openPrefs x
  900. global theData
  901. createFolder SystemPath() & "Preferences"
  902. put SystemPath() & "Preferences:" & x into fileName
  903. if IsFile(filename) then
  904.   open file filename
  905.   read from file filename until empty
  906.   close file filename
  907.   put it into theData
  908. else
  909.   open file fileName
  910.   put "BackGround=TRUEΓëê" & return & "Sound=TRUEΓëê" & return & "Info=FALSEΓëê" & return & "Size= (small)Γëê" & return & "Style=plainΓëê" & return & "FullStyle=ZoomΓëê" & return & "SmallStyle=PlainΓëê" & return & "ThumbStyle=DialogΓëê" & return & "bgColor=256Γëê" & return & "ifXL=Γëê" into theData
  911.   write theData to file fileName
  912.   close file fileName
  913. end if
  914. return theData
  915. end openPrefs
  916. on checkColor
  917.   global windowName
  918.   if there is a window windowName then hide window windowName
  919.   if word 1 of screenInfo(MAIN) Γëñ 256 then
  920.     picture "a",resource, dialog -- show to reset clut
  921.     close window "a"
  922.   end if
  923. end checkColor
  924.